#ifndef BASE_WIDGET_H
#define BASE_WIDGET_H

#include <QMainWindow>
#include <QVBoxLayout>

#include "header_widget.h"
#include "home_widget.h"
#include "graphic_widget.h"
#include "manage_widget.h"
#include "misc_widget.h"
#include "thread_serialport.h"

QT_BEGIN_NAMESPACE
namespace Ui { class BaseWidget; }
QT_END_NAMESPACE

class BaseWidget : public QWidget
{
    Q_OBJECT

public:
    BaseWidget(QWidget *parent = nullptr);
    ~BaseWidget();

signals:
    void thrdser_recieve(std::shared_ptr<QByteArray> sba);

public slots:
    void slot_operateChange(HeaderWidget::OperateType type);

    void slot_thrdser_connected();
    void slot_thrdser_readdata(std::shared_ptr<QByteArray> sba);
    void slot_thrdser_send(std::shared_ptr<QByteArray> sba);

private:
    Ui::BaseWidget *ui;

    HeaderWidget *header;
    HomeWidget *home;
    GraphicWidget *graphic;
    ManageWidget *manage;
    MiscWidget *misc;

    QVBoxLayout *mainLayout;

    ThreadSerialPort  *m_thdser;
};
#endif // BASE_WIDGET_H
